import {createRouter, createWebHashHistory} from 'vue-router'

import Login from "@/components/Login.vue";
import Frame from "@/components/Frame.vue";
import Welcome from "@/components/Welcome.vue";
import Merchant from "@/components/Merchant.vue";
import Users from "@/components/Users.vue";
import Order from "@/components/Order.vue";
import MerchantDetail from "@/components/MerchantDetail.vue";

const routes = [
    { path: '/', redirect: 'login'},
    { path: '/login', component: Login, name: 'login'},
    { path: '/home',component: Frame, name: 'home',
        redirect: '/welcome',
        children:[
            { path: '/welcome', component:  Welcome, name: 'welcome'},
            { path: '/users', component:  Users, name: 'users'},
            { path: '/merchant', component:  Merchant, name: 'merchant'},
            { path: '/merchant_detail', component:  MerchantDetail, name: 'merchant_detail'},
            { path: '/order', component:  Order, name: 'order'},
        ]
    }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes,
})

export default router
